<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <!-- 引入Vue 全局注册一个名为Vue的构造函数 -->
 <script src="./js/vue.js"></script>
 <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <title>vueaxiox练习</title>
</head>
<body>
    <div id="app">
        <div>  名称：{{info.name}}</div>
        <div> url:{{info.url}}</div>
        <ul>
            <li v-for="link in info.links"><a v-bind:href="link.url">
                
              {{link.name}}
            </a></li>
        </ul>
    </div>
    <script>

        var app =new Vue({
            el:"#app",
            data(){
                return{
                    info:{
                        name:'',
                        url:'',
                        links:[]
                    }
                }
            },
            mounted(){
           axios
           .get('./jsondata/data.json')
           .then(reponse=> this.info=reponse.data)
            }
        })
    </script>
</body>
</html>